<% gcp_project_id = "#{external_attribute(pwd, 'gcp_project_id', doc_generation)}" -%>
<% gcp_location = "#{external_attribute(pwd, 'gcp_location', doc_generation)}" -%>
<% gcp_db_instance_name = "#{external_attribute(pwd, 'gcp_db_instance_name', doc_generation)}" -%>
<% gcp_db_user_name = "#{external_attribute(pwd, 'gcp_db_user_name', doc_generation)}" -%>

describe google_sql_user(project: <%= gcp_project_id -%>, database: <%= gcp_db_instance_name -%>, name: <%= gcp_db_user_name -%>, host: "example.com") do
  it { should exist }
  its('name') { should cmp <%= gcp_db_user_name -%> }
  its('instance') { should cmp <%= gcp_db_instance_name -%> }
end

describe google_sql_user(project: <%= gcp_project_id -%>, database: <%= gcp_db_instance_name -%>, name: "nonexistent", host: "example.com") do
  it { should_not exist }
end